package com.braska.hewankurban;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class PilihHewanActivity extends Activity{
	Button btn_kambing;
	Button btn_sapi;
	Button btn_domba;
	TextView kambing;
	TextView sapi;
	TextView domba;
	Intent i;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pilihhewan);
		btn_kambing = (Button) findViewById(R.id.btn_kambing);
		btn_sapi = (Button) findViewById(R.id.btn_sapi);
		btn_domba = (Button) findViewById(R.id.btn_domba);
	//	kambing = (TextView) findViewById(R.id.txt_kambing);
		//sapi = (TextView) findViewById(R.id.txt_sapi);
		//domba = (TextView) findViewById(R.id.txt_domba);
		
		Bundle extras = getIntent().getExtras();
		final String nama = extras.getString("nama");
		final String id_user = extras.getString("id");
		 i = new Intent(getApplicationContext(), PeriksaActivity.class);
		btn_kambing.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				i.putExtra("jenis", "2");
				i.putExtra("nama", nama);
				i.putExtra("id", id_user);
//				i.putExtra("nama", "paijo");
//				i.putExtra("id", "1");
				startActivity(i);
				finish();
			}
		});
		
		btn_sapi.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
			//	 Intent j = new Intent(getApplicationContext(), PeriksaActivity.class);
				i.putExtra("jenis", "1");
			i.putExtra("nama", nama);
			i.putExtra("id", id_user);
//			i.putExtra("nama", "paijo");
//			i.putExtra("id", "1");
				startActivity(i);
				finish();
			}
		});
		
		btn_domba.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// Intent k = new Intent(getApplicationContext(), PeriksaActivity.class);
				i.putExtra("jenis", "3");
				i.putExtra("nama", nama);
				i.putExtra("id", id_user);
//				i.putExtra("nama", "paijo");
//				i.putExtra("id", "1");
				startActivity(i);
				finish();
			}
		});
		
	}
}
